configure_file(
  ${CMAKE_CURRENT_SOURCE_DIR}/TestSuiteConfig.hpp.in
  ${CMAKE_CURRENT_SOURCE_DIR}/TestSuiteConfig.hpp)

SET(TEST_LIBRARIES
  ${ROBWORKSTUDIO_LIBRARIES}
  ${RW_DRAWABLE_LIBRARY_LIST}
  ${RW_PATHPLANNERS_LIBRARY_LIST}
  ${RW_PROXIMITYSTRATEGIES_LIBRARY_LIST}
  ${ROBWORK_LIBRARIES}
)

SET(COMMON_TEST_SRC
  common/CommonTest.cpp
)

SET(TEST_DEPENDENCIES 
    rwstudio
)
  
# Repeat for each test 
ADD_EXECUTABLE( common-test ${DO_EXCLUDE} test-main.cpp ${COMMON_TEST_SRC})       
TARGET_LINK_LIBRARIES( common-test ${TEST_LIBRARIES} )
ADD_TEST( common-test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/common-test )
ADD_DEPENDENCIES(common-test ${TEST_DEPENDENCIES})

ADD_CUSTOM_TARGET(tests ctest -V 
  DEPENDS common-test ${TEST_DEPENDENCIES}
    WORKING_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")

INSTALL(TARGETS common-test DESTINATION ${RWS_BIN_INSTALL_DIR})
